'use strict';

const Controller = require('egg').Controller;

class ManagerController extends Controller {

  async manager() {
    const { ctx, app } = this;
    const nsp = app.io.of('/manager');
    const data = ctx.args[0] || {};

    console.log('----------------------------', data, '-----------------------------');
    try {
      await nsp.emit('manager', {
        msg: '结单成功',
      });

    } catch (e) {
      await nsp.emit('manager', {
        msg: '出错了',
      });
    }
  }
}

module.exports = ManagerController;
